﻿<Page
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:Reference.Apps"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:Interactivity="using:Microsoft.Xaml.Interactivity" xmlns:Core="using:Microsoft.Xaml.Interactions.Core"
    x:Class="Reference.Apps.GroupView"
    mc:Ignorable="d"
    RequestedTheme="Light">

	<Page.Background>
		<StaticResource ResourceKey="ApplicationPageBackgroundBrush"/>
	</Page.Background>
	<Page.DataContext>
		<Binding Mode="OneWay" Path="Main" Source="{StaticResource VMLocator}"/>
	</Page.DataContext>
	<Page.BottomAppBar>
		<CommandBar>
			<AppBarButton x:Uid="WP8ViewMoreAppBarButton" Icon="Forward" Label="siguientes" >
				<Interactivity:Interaction.Behaviors>
					<Core:EventTriggerBehavior EventName="Click">
						<Core:InvokeCommandAction Command="{Binding GetNextSnippetsCommand, Mode=OneWay}"/>
					</Core:EventTriggerBehavior>
				</Interactivity:Interaction.Behaviors>
			</AppBarButton>
		</CommandBar>
	</Page.BottomAppBar>

	<Grid x:Name="LayoutRoot" DataContext="{Binding SelectedCodeGroup}">

		<Grid.ChildrenTransitions>
			<TransitionCollection>
				<EntranceThemeTransition/>
			</TransitionCollection>
		</Grid.ChildrenTransitions>

		<Grid.RowDefinitions>
			<RowDefinition Height="Auto"/>
			<RowDefinition Height="*"/>
		</Grid.RowDefinitions>

		<!-- Title Panel -->
		<StackPanel Grid.Row="0" Margin="19,0,0,0">
			<TextBlock x:Uid="WP8AppNameTextBlock"  Text="reference" Style="{ThemeResource TitleTextBlockStyle}" Margin="0,12,0,0" Foreground="{StaticResource ApplicationContrastBackgroundBrush}"/>
			<TextBlock Text="{Binding Name, Converter={StaticResource LowerConverter}}" Margin="0,-6.5,0,26.5" Style="{ThemeResource HeaderTextBlockStyle}" CharacterSpacing="{ThemeResource PivotHeaderItemCharacterSpacing}" Foreground="{StaticResource ApplicationContrastBackgroundBrush}"/>
		</StackPanel>

        <!--TODO: Content should be placed within the following grid-->
		<Grid Grid.Row="1" x:Name="ContentRoot" Margin="19,9.5,19,0">
            <ListView ItemTemplate="{StaticResource WPCodeSnippetTemplate}" ItemsSource="{Binding Snippets}" ItemClick="SnippetsListItem_Click" IsItemClickEnabled="True" />
		</Grid>
	</Grid>
</Page>
